home *** CD-ROM | disk | FTP | other *** search
/ PC-Blue - MS DOS Public Domain Library / PC-Blue MS-DOS Public Domain Library - NYACC.iso / vol117 / printmar.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1986-12-15  |  4.6 KB  |  172 lines

  1. 90  WIDTH "scrn:", 80
  2. 95  SCREEN 0,1,0,0
  3. 100  TITLE$ = "Print the Marriages File Program"
  4. 105  TITLE$ = TITLE$ + " ON DISPLAY"
  5. 110  VERSION$ = "Version 3.0"
  6. 115  COPY1$ = "Copyright (c) 1983, 1984, 1985, by:"
  7. 120  COPY2$ = "Melvin O. Duke"
  8. 125  PRICE$ = "$35"
  9. 130  ADDR1$ = "Melvin O. Duke"
  10. 135  ADDR2$ = "P. O. Box 20836"
  11. 140  ADDR3$ = "San Jose, CA  95160"
  12. 145  REM Dimension Statements go here
  13. 170  REM Produce the first screen
  14. 175  KEY OFF : CLS
  15. 180  REM Draw the outer double box
  16. 185  R1 = 1 : C1 = 1 : R2 = 24 : C2 = 79 : GOSUB 400
  17. 190  REM Find the title location
  18. 195  TITLE.POS = 40 - INT(LEN(TITLE$)/2)
  19. 200  REM Draw the title box
  20. 205  R1=3:C1=TITLE.POS-2:R2=6:C2=TITLE.POS+LEN(TITLE$)+1:GOSUB 600
  21. 210  REM Print the title
  22. 215  LOCATE 4,TITLE.POS : PRINT TITLE$
  23. 220  LOCATE 5,40-INT(LEN(VERSION$)/2) :  PRINT VERSION$;
  24. 225  REM Draw the Contribution box
  25. 230  R1 = 8 : C1 = 19 : R2 = 17 : C2 = 62 : GOSUB 400
  26. 235  REM Request the Contribution
  27. 240  LOCATE 9,23 : PRINT "If you are using these programs, and"
  28. 245  LOCATE 10,21 : PRINT "finding them of value, your contribution"
  29. 250  LOCATE 11,23 : PRINT "("+PRICE$+" suggested) will be anticipated."
  30. 255  REM Draw the Mailing Label
  31. 260  R1 = 12 : C1 = 28 : R2 = 16 : C2 = 52 : GOSUB 600
  32. 265  REM Print the Name and Address
  33. 270  LOCATE 13,40-INT(LEN(ADDR1$)/2) :  PRINT ADDR1$;
  34. 275  LOCATE 14,40-INT(LEN(ADDR2$)/2) :  PRINT ADDR2$;
  35. 280  LOCATE 15,40-INT(LEN(ADDR3$)/2) :  PRINT ADDR3$;
  36. 285  REM Draw the Copyright box
  37. 290  R1 = 19 : C1 = 21 : R2 = 22 : C2 = 59 : GOSUB 400
  38. 295  REM Print the Copyright
  39. 300  LOCATE 20,40-INT(LEN(COPY1$)/2) :  PRINT COPY1$;
  40. 305  LOCATE 21,40-INT(LEN(COPY2$)/2) :  PRINT COPY2$;
  41. 310  GOTO 740
  42. 400  REM subroutine to print a double box
  43. 405  COLOR 5
  44. 410  FOR I = R1 + 1 TO R2 - 1
  45. 420   LOCATE I, C1 : PRINT CHR$(186);
  46. 430   LOCATE I, C2 : PRINT CHR$(186);
  47. 440  NEXT I
  48. 450  FOR J = C1 + 1 TO C2 - 1
  49. 460   LOCATE R1, J : PRINT CHR$(205);
  50. 470   LOCATE R2, J : PRINT CHR$(205);
  51. 480  NEXT J
  52. 490   LOCATE R1, C1 : PRINT CHR$(201);
  53. 500   LOCATE R1, C2 : PRINT CHR$(187);
  54. 510   LOCATE R2, C1 : PRINT CHR$(200);
  55. 520   LOCATE R2, C2 : PRINT CHR$(188);
  56. 525  COLOR 7
  57. 530  RETURN
  58. 600  REM subroutine to print a single box
  59. 605  COLOR 3
  60. 610  FOR I = R1 + 1 TO R2 - 1
  61. 620   LOCATE I, C1 : PRINT CHR$(179);
  62. 630   LOCATE I, C2 : PRINT CHR$(179);
  63. 640  NEXT I
  64. 650  FOR J = C1 + 1 TO C2 - 1
  65. 660   LOCATE R1, J : PRINT CHR$(196);
  66. 670   LOCATE R2, J : PRINT CHR$(196);
  67. 680  NEXT J
  68. 690   LOCATE R1, C1 : PRINT CHR$(218);
  69. 700   LOCATE R1, C2 : PRINT CHR$(191);
  70. 710   LOCATE R2, C1 : PRINT CHR$(192);
  71. 720   LOCATE R2, C2 : PRINT CHR$(217);
  72. 725  COLOR 7
  73. 730  RETURN
  74. 740  REM ask user to press a key to continue
  75. 750  LOCATE 25,1
  76. 760  PRINT "Have Data Diskette(s) in Place, then Press any key to continue.";
  77. 770  K$ = INKEY$ : IF K$ = "" THEN 770
  78. 780  CLS
  79. 1000  REM Print the Marriages File Program.
  80. 1010  REM By:  Melvin O. Duke.  Last Updated:  24 December 1984.
  81. 1020  OPEN "a:persfile" AS #1 LEN = 256
  82. 1030  FIELD 1, 5 AS F1$, 20 AS F2$, 30 AS F3$, 2 AS F4$, 5 AS F5$, 5 AS F6$, 5 AS F7$, 11 AS F8$, 18 AS F9$, 16 AS F10$, 16 AS F11$, 11 AS F12$, 18 AS F13$, 16 AS F14$, 16 AS F15$, 11 AS F16$, 18 AS F17$, 16 AS F18$, 16 AS F19$
  83. 1040  OPEN "a:marrfile" AS #2 LEN = 128
  84. 1050  FIELD 2, 5 AS M1$, 5 AS M2$, 5 AS M3$, 5 AS M4$, 11 AS M5$, 18 AS M6$, 16 AS M7$, 16 AS M8$, 45 AS M9$
  85. 1060  REM Determine User Wants
  86. 1070  CLS : LOCATE 21,1
  87. 1080  INPUT "Enter the Marriage Number to be Printed (0 to quit), or 'all'"; REPLY$
  88. 1090  IF REPLY$ = "0" THEN 1880
  89. 1100  K = 0
  90. 1110  GOTO 1160
  91. 1120  LPRINT TAB(10);"Print-out of Contents of the Marriages File"
  92. 1130  LPRINT TAB(10);DATE$,TIME$
  93. 1140  LPRINT
  94. 1150  RETURN
  95. 1160  IF REPLY$ = "all" THEN 1230
  96. 1170  K = 4
  97. 1180  I = VAL(REPLY$)
  98. 1190  IF I = 0 THEN 1880
  99. 1200  IF I < 1 OR I > 200 THEN 1060
  100. 1210  GOSUB 1120
  101. 1220  GOSUB 1270 : GOTO 1070
  102. 1230  REM Read all records, and print the actual ones
  103. 1240  FOR I = 1 TO 200
  104. 1250  GOSUB 1270
  105. 1260  GOTO 1810
  106. 1270  GET #2, I
  107. 1280  REM Extract information from the file for use
  108. 1290  T1 = CVS(M1$)
  109. 1300  IF T1 < 1 THEN 1800
  110. 1310  K = K + 1
  111. 1320  IF K MOD 5 = 1 THEN GOSUB 1120
  112. 1330  T2 = CVS(M2$)
  113. 1340  T3 = CVS(M3$)
  114. 1350  T4 = CVS(M4$)
  115. 1360  T5$ = M5$
  116. 1370  T6$ = M6$
  117. 1380  T7$ = M7$
  118. 1390  T8$ = M8$
  119. 1400  T9$ = M9$
  120. 1410  REM obtain the name of the husband
  121. 1420  GET #1, T2
  122. 1430  REM obtain the last and given names
  123. 1440  TEMP$ = F2$ 'Husband`s last name
  124. 1450  TMP$ = F2$
  125. 1460  GOSUB 1830
  126. 1470  TT2$ = TMP$
  127. 1480  TEMP$ = F3$ 'Husband's given names
  128. 1490  TMP$ = F3$
  129. 1500  GOSUB 1830
  130. 1510  TT3$ = TMP$
  131. 1520  REM obtain the name of the wife
  132. 1530  GET #1, T3
  133. 1540  REM obtain the last and given names
  134. 1550  TEMP$ = F2$ 'Wife`s last name
  135. 1560  TMP$ = F2$
  136. 1570  GOSUB 1830
  137. 1580  TT4$ = TMP$
  138. 1590  TEMP$ = F3$ 'Wife's given names
  139. 1600  TMP$ = F3$
  140. 1610  GOSUB 1830
  141. 1620  TT5$ = TMP$
  142. 1630  REM Now Print the Information
  143. 1640  LPRINT TAB(10);"Marriage Record-number : ";
  144. 1650  LPRINT USING "###"; T1
  145. 1660  LPRINT TAB(10);"Husband's Record Number: ";
  146. 1670  LPRINT USING "###"; T2;
  147. 1680  LPRINT TAB(42); TT2$+", "+TT3$
  148. 1690  LPRINT TAB(10);"Wife`s Record Number   : ";
  149. 1700  LPRINT USING "###"; T3;
  150. 1710  LPRINT TAB(42); TT4$+", "+TT5$
  151. 1720  LPRINT TAB(10);"Marriage-date          : ";T5$
  152. 1730  LPRINT TAB(10);"Marriage-city          : ";T6$
  153. 1740  LPRINT TAB(10);"Marriage-county        : ";T7$
  154. 1750  LPRINT TAB(10);"Marriage-state         : ";T8$
  155. 1760  LPRINT TAB(10);"Comments: ";T9$
  156. 1770  LPRINT
  157. 1780  LPRINT : LPRINT
  158. 1790  IF K MOD 5 = 0 THEN LPRINT CHR$(12);
  159. 1800  RETURN
  160. 1810  NEXT I
  161. 1820  GOTO 1880
  162. 1830  REM rtrim$ subroutine
  163. 1840  FOR J = 1 TO LEN(TEMP$)-1
  164. 1850   IF RIGHT$(TMP$,1)=" " THEN TMP$ = LEFT$(TMP$,LEN(TMP$)-1) ELSE J = LEN(TEMP$)-1
  165. 1860  NEXT J
  166. 1870  RETURN
  167. 1880  CLOSE #1
  168. 1890  CLS : LOCATE 21,1
  169. 1900  PRINT "End of Program"
  170. 1910  LPRINT CHR$(12);
  171. 1920  RUN "a:menu"
  172.